package com.edgclub.edg.model.result;


import com.edgclub.edg.Constant;
import com.edgclub.edg.model.GroupBean;
import com.edgclub.edg.model.User;
import com.hyphenate.easeui.model.ChatBean;

import java.io.Serializable;

public class RunData implements Serializable{

	private String data="0";

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public static ChatBean getChatBeanMode(GroupBean groupBean, User user){
		ChatBean chatBean=new ChatBean();
		if(null!=groupBean) {
			chatBean.setChatType(Constant.CHATTYPE_GROUP);
			chatBean.setGroupid(groupBean.getGroupid());
			chatBean.setImid(groupBean.getGimid());
			chatBean.setName(groupBean.getGname());
			chatBean.setGno(groupBean.getGno());
			chatBean.setLogo(groupBean.getLogo());
		}else{
			chatBean.setChatType(Constant.CHATTYPE_SINGLE);
			chatBean.setId(user.getId());
			chatBean.setImid(user.getImid());
			chatBean.setName(user.getNick());
			chatBean.setUsername(user.getUsername());
			chatBean.setLogo(user.getLogo());
		}

		return chatBean;
	}
	public static User getUserBeanMode( ChatBean chatBean){
		User user=new User();
		user.setId(chatBean.getId());
		user.setImid(chatBean.getImid());
		user.setNick(chatBean.getName());
		user.setLogo(chatBean.getLogo());

		return user;
	}
}
